package cn.com.nes.site.service.crm.customer;

import cn.com.nes.mybatis.agent.crm.entity.Customer;
import cn.com.nes.site.entity.PageData;
import cn.com.nes.site.entity.vo.NullVO;
import cn.com.nes.site.entity.vo.crm.*;
import cn.com.nes.site.service.crm.customer.bo.CustomerBO;
import cn.com.nes.site.service.crm.customer.bo.CustomerPageBO;
import cn.com.nes.site.service.crm.customer.bo.GetCustomerDetailBO;
import cn.com.nes.site.service.crm.customer.dto.CustomerDTO;
import cn.com.nes.site.service.crm.customer.dto.CustomerDetailDTO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

public interface CrmCustomerService extends IService<Customer> {


    CustomerDTO customerSave(CustomerBO customerBO) throws Exception;


    CustomerDTO saveCrmCustomer(SaveCustomerVo vo) throws Exception;


    PageData clueToCustomer(ClueToCustomerVo vo) throws Exception;


    PageData assignCustomers(AssignCustomersVo vo) throws Exception;


    PageData claimCustomer(ClaimCustomerVo vo) throws Exception;


    CustomerDTO getCustomerByPhone(String phone,String companyId);


    CustomerDTO getCustomerByIdCard(HashMap<String, Object> hashMap);


    CustomerDTO getCustomerById(String uuid);


    Page<Customer> customerPage(CustomerPageBO customerPageBo) throws Exception;


    /**
     * 根据行政区划代码和项目id查询客户id列表
     */
    List<String> getCustomerIdListByAreaCode(String areaCode, Long projectId);


    /**
     * 查询客户详情
     */
    CustomerDetailDTO getCustomerDetail(GetCustomerDetailBO bo) throws Exception;


    /**
     * 补充客户信息
     */
    PageData replenishCustomerInfo(ReplenishCustomerInfoVO vo) throws Exception;


    /**
     * 查询补充客户信息所需要的下拉框内容
     */
    PageData replenishCustomerDropdownBox(NullVO vo) throws Exception;


    /**
     * 删除客户
     * @param ids           客户ID列表
     * @param operateUserId 操作人ID
     * @param operateDate   操作时间
     */
    void deleteByIds(List<String> ids, Long operateUserId, Date operateDate) throws Exception;


    List<String> getCustomerIdListByCustomerName(String customerName);


    Customer getCustomerByIdCardNumber(String companyId, String idCardNumber) throws Exception;

    /**
     * 只保存客户信息,不生成其他数据
     */
    Customer onlySaveCustomer(CustomerBO customerBO) throws Exception;
}
